﻿@using thousandClear.Areas.Admin.Models;
@model ProjectModel
@{
    ViewBag.Title = "修改项目";
    Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
}

<div id="app">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">后台管理</strong> / <small>@ViewBag.Title</small></div>
    </div>
    <div class="am-tabs am-margin" data-am-tabs>
        <div class="am-tabs-bd">
            <form action="" onsubmit="return check()" method="post" class="am-form" id="form">
                <fieldset>
                    <div class="am-form-group">
                        <label for="ProjectName">项目名称：</label>
                        <input type="text" id="ProjectName" placeholder="请输入名称(必填)" required v-model="ProjectName" />
                    </div>
                    <div class="am-form-group">
                        <label for="ProjectDesc">项目详情：</label>
                        <input type="text" id="ProjectDesc" placeholder="请输入详情(必填)" required v-model="ProjectDesc" />
                    </div>
                    <div class="am-form-group">
                        <label for="ProjectType">项目类型：</label>
                        <select id="ProjectType" v-model="ProjectType">
                            <option value="1">必选</option>
                            <option value="2">手选</option>
                        </select>
                    </div>
                    <div class="am-form-group">
                        <label for="dimTotalRate">价格：</label>
                        <input type="text" id="dimTotalRate" placeholder="请输入价格(必填)" required v-model="dimTotalRate" />
                    </div>
                  
                    <input type="hidden" name="data" v-bind:value="data" />
                    <button v-bind:click="test()" class="am-btn am-btn-secondary" type="submit">提交</button>

                </fieldset>
            </form>
        </div>
    </div>
</div>
@section Scripts{
    <script src="~/Statics/Venders/uedit-1.4.3.1/ueditor.config.js"></script>
    <script src="~/Statics/Venders/uedit-1.4.3.1/ueditor.all.min.js"></script>
    <script>
        var model = new Vue({
            el: '#app',
            data: {
                DIMID:'@Model.DIMID',
                ProjectName: '@Model.dimName',
                ProjectType: @Model.dimType,
                ProjectDesc: '@Model.dimDesc',
                dimTotalRate:'',
            },
            computed: {
                data: function () {
                    return JSON.stringify(this._data);
                }
            },
            methods: {
            }

        })
        $('#doc-vld-msg').validator({
            onValid: function (validity) {
                $(validity.field).closest('.am-form-group').find('.am-alert').hide();
            },

            onInValid: function (validity) {
                var $field = $(validity.field);
                var $group = $field.closest('.am-form-group');
                var $alert = $group.find('.am-alert');
                // 使用自定义的提示信息 或 插件内置的提示信息
                var msg = $field.data('validationMessage') || this.getValidationMessage(validity);

                if (!$alert.length) {
                    $alert = $('<div class="am-alert am-alert-danger"></div>').hide().
                      appendTo($group);
                }

                $alert.html(msg).show();
            }
        });
        $('.admin-sidebar-Project').addClass('current');
    </script>
}
